package cn.yeamin.spring.boot.dao;

import cn.yeamin.spring.boot.vo.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @packageName: 包名: cn.yeamin.spring.boot.dao
 * @classDesc: 类功能描述:()
 * @author: Administrator
 * @createTime: 2017/7/19 16:23
 * @version: v1.0
 * @copyright:奕明(上海)影视传媒有限公司
 */
//@Mapper  //声明是Mybatis的Mapper接口,要省略必须在启动类上加包扫描
public interface UserMapper {

    @Select("SELECT * FROM tb_user WHERE NAME = #{name}")
    User findByName(@Param("name") String name);

    @Select("SELECT * FROM tb_user")
    List<User> findAll();


    @Insert("INSERT INTO tb_user VALUES(null, #{age},  #{city},#{name})")
    int insert(User user);

    @Delete("delete from tb_user where id = #{id}")
    int deleteById(Integer id);




}
